package com.bing.bean.sys;

import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * Created by kaibb on 2014/10/14.
 */
public class SysUser {
    private int id;
    private int accountId;
    private String name;
    private String address;
    private String salt;
    private SysUserStatus status;
    @Pattern(regexp = "[a-zA-Z\\d]{5,20}", message = "{login.username_format_error}")
    private String username;
    @Pattern(regexp = "[a-zA-Z\\d]{5,20}", message = "{login.password_format_error}")
    private String password;
    private String phone;
    private List<SysRole> sysRoles;
    private boolean rememberMe;

    public boolean isRememberMe() {
        return rememberMe;
    }

    public void setRememberMe(boolean rememberMe) {
        this.rememberMe = rememberMe;
    }

    public int getAccountId() {
        return accountId;
    }

    public void setAccountId(int accountId) {
        this.accountId = accountId;
    }

    public List<SysRole> getSysRoles() {
        return sysRoles;
    }

    public void setSysRoles(List<SysRole> sysRoles) {
        this.sysRoles = sysRoles;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public SysUserStatus getStatus() {
        return status;
    }

    public void setStatus(SysUserStatus status) {
        this.status = status;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("SysUser{");
        sb.append("id=").append(id);
        sb.append(", accountId=").append(accountId);
        sb.append(", name='").append(name).append('\'');
        sb.append(", address='").append(address).append('\'');
        sb.append(", salt='").append(salt).append('\'');
        sb.append(", status=").append(status);
        sb.append(", username='").append(username).append('\'');
        sb.append(", password='").append(password).append('\'');
        sb.append(", phone='").append(phone).append('\'');
        sb.append(", sysRoles=").append(sysRoles);
        sb.append('}');
        return sb.toString();
    }
}
